<div class="row">
	<div class="panel">
		<h6>Add New Subject</h6>
	</div>
	<?=$system_message;?>
	<?php 
		$formAttrib = array('id' => 'addsubject', 'class' => 'admin-form');
		$roomLevelAttrib = array('' => 'Select level assignment..');
		$subjectNameAttrib = array('name' => 'code', 'value' => set_value('code'), 'id' => 'name');
		$subjectDescriptionAttrib = array('name' => 'description', set_value("description"), 'id' => 'description');
		$subjectStatusAttrib = array('active' => 'Active', 'inactive' => 'Inactive');
		echo form_open('room_section_subject/add_subject', $formAttrib);

	?>
    
    <div class="alert-box secondary">

    <div class="row">
	    <div class="large-6 columns">
	    	<label  class="label label-success">Grade Level</label>
	    	<?
	    	if(!empty($levels)){
			  echo form_dropdown('grade_level_id', $levels, set_value('grade_level_id',$selected_grade_level_id),'id="grade_level_id"') ;	
			}else{
			  echo 'Grade Level is empty, please <a href="'.site_url('admin/add_grade_level').'" class="data-link">set grade levels </a>';
			}
			?>
	    </div>
		
		<!-- <div class="large-6 columns">
			<label class="label label-success">Academic Year:</label>
			<?php //echo form_dropdown('academic_year', $academic_year,set_value('academic_year'));	?>
	    </div> -->
    </div>
    
    <div class="row">
	    <div class="large-6 columns">
	    	<label  class="label label-success">Subject Code</label>
		    <?=form_input($subjectNameAttrib);?>
	    </div>
	    <div class="large-6 columns">
	    	<label  class="label label-success">Subject Status</label>
	    	<?= form_dropdown('subj_stat', $subjectStatusAttrib,set_value('subj_stat'));	?>
	    </div>
    </div>

	<div class="row">
		<div class="large-6 columns">
			<label class="label label-success">Notes</label>
			<input type="text" name="subj_uniq_id" value="<?=set_value('subj_uniq_id');?>" placeholder="Notes for this subject">
	    </div>
	    
		<div class="large-6 columns">
			<label class="label label-success">Subject  Name/Description</label>
			<input type="text" name="description" value="<?=set_value('description');?>">
	    </div>
    </div>

    

	
	<div class="row">
		<!-- <div class="large-6 columns">
			<label class="label label-success">Subject Main Parent</label>
			<input type="text" id="parent_subject" name="subject_parent" step="any" value="<?//=set_value('parent_subject');?>">
		</div> -->
		<div class="large-6 columns">
			<label class="label label-success">Subject Unit:</label>
			<input type="number" max="10" min="0" required name="subject_unit" step="any" value="<?=set_value('subject_unit');?>">
		</div>
	</div>
   <!-- <div class="row">
		<div class="large-6 columns">
			<label class="label label-success">Additional Subject Skills</label><span class="info">Separated by semicolon(;)</span>
			<input type="text" id="parent_subject" name="subject_parent" step="any" value="<?//=set_value('subject_parent',$subject->subject_name);?>">
			<textarea name="subject_children"><?=set_value('subject_children');?></textarea>
		</div>
	</div> -->
    <div class="input-block" style="clear:both;">
		<input type="submit" name="add" value="Add Subject" class="btn btn-small btn-primary">
		<hr class="clearfix">
    	<a href="<?=site_url('room_section_subject/subjects');?>" class="btn">Back to Subjects</a>
	</div>
	</form>
	</div>
</div>

  <script>
  $(document).ready(function(){
  	  $(function() {
	    $( "#parent_subject" ).autocomplete({
	      source: "<?=site_url('output/returall_subjectparent');?>"
	    });
	  });
  });
  </script>